package org.fuys.coder.common.config.beans;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.JavaMailSenderImpl;

/**
 * @projectName: fuys-low-coder
 * @package: org.fuys.coder.common.config
 * @className: MailSenderConfig
 * @author: WangJing
 * @description: 邮件发送配置
 * @date: 2024/6/18 20:47
 * @version: 1.0
 */
@Configuration
public class MailSenderConfig {
    @Bean
    public SimpleMailMessage simpleMailMessage(){
        return new SimpleMailMessage();
    }

    @Bean
    public JavaMailSender javaMailSender(){
        JavaMailSenderImpl javaMailSender=new JavaMailSenderImpl();
        javaMailSender.setHost("smtp.qq.com");
        javaMailSender.setPort(465);
        javaMailSender.setUsername("3816618168@qq.com");
        javaMailSender.setPassword("xlsnaxrdawxccdbf");
        javaMailSender.setProtocol("smtps");
        return javaMailSender;
    }
}
